package com.auxgroup.smarthome.inner.controller;

import com.auxgroup.bridge.app.inner.dto.DeviceConnectFailDto;
import com.auxgroup.smarthome.inner.service.DeviceConnectFailService;
import com.auxgroup.smarthome.syscode.Syscode;
import com.auxgroup.smarthome.web.ApiResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by lixiaoxiao on 17-9-11.
 */
@Api(description = "配网失败上传功能", tags = "配网失败上传功能")
@RestController
public class DeviceConnectFailController {
    @Autowired
    private DeviceConnectFailService deviceConnectFailService;

    @ApiOperation(value = "上报配网失败日志", notes = "上报配网失败日志")
    @RequestMapping(value = "/device_connect_fail", method = RequestMethod.POST)
    public ApiResponse addDeviceRepairList(@RequestBody DeviceConnectFailDto deviceConnectFailDto) {
        deviceConnectFailService.saveConnectFail(deviceConnectFailDto);
        return ApiResponse.prompt(Syscode.SC_OK);
    }
}
